package com.service;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.dao.AdminDAO;
import com.entity.Admin;

@Transactional
@Service
public class AdminService {
	@Autowired
	private AdminDAO adminDAO;
	public Admin findByUserName(String userName){
		if(userName != null){
			List<Admin> list = adminDAO.findByUserName(userName);
			if(list != null && list.size() > 0){
				return list.get(0);
			}
		}
		return null;
	}
}
